cmake_minimum_required(VERSION 2.8)

message("-- Project: dispatch")


if (${ANDROID_OS})
	file(GLOB dispatch_src "*.cpp")
	set(interface_src 	src/interface.cc
						src/loadcontainer.cc
						src/msgproxy.cc)
elseif(${UNIX_OS})
	set(dispatch_src 	dllmain.cpp 
						stdafx.cpp 
						stdafx.h)

	file(GLOB interface_src "src/*.cpp")

endif()


if (${UNIX_OS})
	include_directories(
		${PROJECT_SOURCE_DIR}/include
		${PROJECT_SOURCE_DIR}/crt
		${PROJECT_SOURCE_DIR}/extensions/include
		${by3rd_library_include}
		/usr/local/include
		/opt/local/include
		/usr/include
		)
elseif (${WIN_OS})

else()

endif()


add_library(dispatch SHARED ${dispatch_src} ${interface_src})

set_target_properties(dispatch PROPERTIES OUTPUT_NAME "dispatch")
set_target_properties(dispatch PROPERTIES COMPILE_FLAGS ${dynamic})
set_target_properties(dispatch PROPERTIES COMPILE_FLAGS ${compile})
set_target_properties(dispatch PROPERTIES LINK_FLAGS ${r_path})

if(${LINUX_OS})
	target_link_libraries(dispatch dl stdcrt)
endif()

if(${UNIX_OS})
	target_link_libraries(dispatch stdcrt)
endif()




